<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html>
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="./css/all.css">
<link rel="stylesheet" href="./css/nav.css">
<link rel="stylesheet" href="./css/table.css">

<style>
	a{
		margin-left: 45%;
		text-decoration: none;
		color: black;
	}


</style>
<head>
<meta charset="UTF-8">
<title>University Web Main Page</title>

</head>
<body>

	<c:choose>
                   <c:when test="${loginEntity.type  eq 'visitor'}">
                       您是游客，请<a href="login.jsp">登陆</a> 
                   </c:when>
                   <c:otherwise>
					   <nav id="navbar">
						   <h1 class="logo">
							   <spna class="text-primary">
								   <i class="fas fa-book-open"></i></spna>
							   主页

						   </h1>
						   <ul>
							   <li>你好,${loginEntity.username}</li>
							   <li><a href="actionSpace_showSpace.action">个人空间</a></li>

						   </ul>

					   </nav>

                   </c:otherwise>
	</c:choose>

<a href="actionMain_getAnnonceType1" >公告信息栏</a>
	<div class="table-box">
			<table>
		<tr>
			<th>文件名称</th>
			<th>发布日期</th>
		</tr>
		<s:iterator value="storedFileEntities" var="sfs">
			<c:choose>
				<c:when test="${sfs.fileType  eq 'Type1'}">
					<tr>
						<td><a href="download?fileEntity.fileName=${sfs.fileName}">${sfs.fileName}</a></td>
						<td>${sfs.releaseTime}</td>
					</tr>
				</c:when>
			</c:choose>
		</s:iterator>
	</table>
	</div>




<a href="actionMain_getAnnonceType2"style="color: black">教务公告栏</a>
	<div class="table-box">
		<table>
		<tr>
			<th>文件名称</th>
			<th>发布日期</th>
		</tr>
		<s:iterator value="storedFileEntities" var="sfs">
			<c:choose>
				<c:when test="${sfs.fileType  eq 'Type2'}">
					<tr>
						<td><a href="${sfs.fileLocation}">${sfs.fileName}</a></td>
						<td>${sfs.releaseTime}</td>
					</tr>
				</c:when>
			</c:choose>
		</s:iterator>
	</table>
	</div>

<a href="actionMain_getAnnonceType3"style="color: black">企业招聘信息</a>
	<div class="table-box">
		<table>
			<tr>
				<th>文件名称</th>
				<th>发布日期</th>
			</tr>
			<s:iterator value="storedFileEntities" var="sfs">
				<c:choose>
					<c:when test="${sfs.fileType  eq 'Type3'}">
						<tr>
							<td><a href="${sfs.fileLocation}">${sfs.fileName}</a></td>
							<td>${sfs.releaseTime}</td>
						</tr>
					</c:when>
				</c:choose>

			</s:iterator>
		</table>
	</div>

<a href="actionMain_getAnnonceType4"style="color: black">培养计划</a>
	<div class="table-box">
		<table>
			<tr>
				<th>文件名称</th>
				<th>发布日期</th>
			</tr>
			<s:iterator value="storedFileEntities" var="sfs">
				<c:choose>
					<c:when test="${sfs.fileType  eq 'Type4'}">
						<tr>
							<td><a href="${sfs.fileLocation}">${sfs.fileName}</a></td>
							<td>${sfs.releaseTime}</td>
						</tr>
					</c:when>
				</c:choose>
			</s:iterator>
		</table>
	</div>


</body>
</html>